package com.dys.designpattern.singleton.threadpool;

import java.util.concurrent.Callable;

/**
 * @Author: 疾风
 * @ClassName: MyTask
 * @Description: 任务类
 * @CreateDate: 2024/05/11
 * @Version: v1.0.0
 */
public class MyTask implements Callable {

    // 处理传进来的数据
    private final String DATA;

    public MyTask(final String data) {
        this.DATA = data;
    }

    @Override
    public Object call() throws Exception {
        System.out.println("==============正在处理收到的data：" + DATA);
        // 模拟处理数据需要花点小时间
        Thread.sleep(1000);
        return "处理成功";
    }
}
